//注册
const db = require("../lib/db");
const db=require("../lib/db.js.js")
function addUser(userId,userName,userPassword,headImg){
    console.log(userId,userName,userPassword,headImg)
    return new Promise((resolve,reject)=>{
        let sql = `insert into user(userId,userName,userPassword,headImg)values(${userId},'${userName}','${userPassword}',${headImg})`
        db.quarySql(sql).then(data =>{
            console.log(data)
            if(data.length == 0){
            resolve(500)
            }else{
                resolve(200)
            }
        })
   })

}
//导出
module.exports=addUser;